﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="list.aspx.vb" Inherits="WSADProject.list" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">

    
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
 
       <asp:GridView ID="GridView1" runat="server" AllowPaging="true" PageSize="5" HeaderStyle-ForeColor="White" DataSourceID="SqlDataSource1" AllowSorting="True" AutoGenerateColumns="False" Width="785px">
        <Columns>
   <asp:TemplateField HeaderText="Picture">

            <EditItemTemplate>

                <asp:TextBox ID="TextBox1" runat="server" Text='<%# 
Bind("UserID") %>'></asp:TextBox>

            </EditItemTemplate>

            <ItemTemplate>

                <asp:HyperLink ID="hlImage1" runat="server" ImageUrl='<%# 
Bind("ProfilePicturesmall") %>' NavigateUrl ='<%# String.Format("details.aspx?id={0}", Eval("UserID"))%>'></asp:HyperLink>

                

            </ItemTemplate>

        </asp:TemplateField>
         


            <asp:TemplateField HeaderText="Name" 
SortExpression="FirstName">

            <EditItemTemplate>

                <asp:TextBox ID="TextBox1" runat="server" Text='<%# 
Bind("FirstName") %>'></asp:TextBox>

            </EditItemTemplate>

            <ItemTemplate>

                <asp:Label ID="Label1" runat="server" Text='<%# 
Bind("FirstName") %>'></asp:Label>

                <asp:Label ID="Label2" runat="server" Text='<%# 
Eval("LastName") %>'></asp:Label>

            </ItemTemplate>

        </asp:TemplateField>
            <asp:BoundField DataField="Gender" HeaderText="Gender" SortExpression="Gender" />
            <asp:BoundField DataField="ProfilePicturesmall" HeaderText="ProfilePicturesmall" SortExpression="ProfilePicturesmall" Visible="False" />
            <asp:BoundField DataField="Country" HeaderText="Country" SortExpression="Country" />
             <asp:BoundField DataField="dateval" HeaderText="Last Activity Date" DataFormatString="{0:d}" SortExpression="dateval" />
             <asp:BoundField DataField="timeval" HeaderText="Last Activity Time" DataFormatString="{0:T}" />
            <asp:HyperLinkField DataNavigateUrlFields="UserID" DataNavigateUrlFormatString="details.aspx?id={0}" HeaderText="View Details" Text="View" />
              </Columns>
           <PagerSettings Mode="NumericFirstLast" PageButtonCount="4"  FirstPageText="First" LastPageText="Last"/> 
<PagerStyle Font-Bold="true" ForeColor="White" /> 
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:fishconn %>" ProviderName="<%$ ConnectionStrings:fishconn.ProviderName %>" SelectCommand="SELECT tblProfile.FirstName, tblProfile.LastName, tblProfile.Gender, tblProfile.ProfilePicturesmall, tblProfile.Country, tblProfile.UserID,tblProfile.Username ,datevalue(aspnet_Users.LastActivityDate) as dateval,timevalue(aspnet_Users.LastActivityDate) as timeval 
FROM tblProfile INNER JOIN aspnet_Users ON tblProfile.UserName = aspnet_Users.UserName order by aspnet_Users.LastActivityDate desc"></asp:SqlDataSource>
       <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:fishconn %>" ProviderName="<%$ ConnectionStrings:fishconn.ProviderName %>" SelectCommand="SELECT tblProfile.FirstName, tblProfile.LastName, tblProfile.Gender, tblProfile.ProfilePicturesmall, tblProfile.Country, tblProfile.UserID, tblProfile.UserName, datevalue(aspnet_Users.LastActivityDate) AS dateval, timevalue(aspnet_Users.LastActivityDate) AS timeval FROM (tblProfile INNER JOIN aspnet_Users ON tblProfile.UserName = aspnet_Users.UserName) WHERE (tblProfile.UserName = ?) ORDER BY aspnet_Users.LastActivityDate DESC">
           <SelectParameters>
               <asp:QueryStringParameter Name="?" QueryStringField="Username" />
           </SelectParameters>
       </asp:SqlDataSource>
       <p>
      
        <br />
   
</asp:Content>
